#pragma once
#include "JeolSource.h"
#include "ThreadClient.h"

// Dump Reader
class CAdcDump :  public IJeolSource
{
private:

	enum { BLOCKS = 2 };

	HANDLE         m_hFile;
	LARGE_INTEGER  m_iFileSize;
	HANDLE         m_hMap;
	SHORT *        m_pDumpData;

	LARGE_INTEGER  m_iFreq;
	LARGE_INTEGER  m_iTime;
	ULONG64        m_nRequests;
	ULONG          m_nPollingPeriod;
	double         m_fKadrRate;

	IDataReceiver *    m_pDataReceiver;

private:

	CWorkerThread <> m_WorkerThread;
	CTimerClient < CAdcDump > m_TimerClient;

	HRESULT OnTimer(DWORD_PTR dwParam);

public:

	CAdcDump(void);
	virtual ~CAdcDump(void);

public: // IJeolSource

	virtual BOOL Open(const void * pszFileName);
	virtual void Close(void);

	virtual BOOL Start(IDataReceiver * pDataReceiver);
	virtual void Stop(void);
};
